<fieldset class="layui-elem-field layui-field-title" >
    <legend><?echo $l_xitong_gaikuang?></legend>
</fieldset>



<div class="static">

<div class="box"><h6><i class="layui-icon">&#xe629;</i>客户人数</h6><hr class="layui-bg-green">
    <div class="content">
        <?php echo $member_number;?>
    </div>
</div>




    <div class="box"><h6><i class="layui-icon">&#xe629;</i>总运单数</h6><hr class="layui-bg-green">
        <div class="content">
            <?php echo $order_number;?>
        </div>
    </div>




    <div class="box"><h6><i class="layui-icon">&#xe629;</i>总金额</h6><hr class="layui-bg-green">
        <div class="content">
            <?php echo $order_sum_info['price_sum'];?>
        </div>
    </div>

    <div class="box"><h6><i class="layui-icon">&#xe629;</i>总优惠金额</h6><hr class="layui-bg-green">
        <div class="content">
            <?php echo $order_sum_info['discount_sum'];?>
        </div>
    </div>

    <!--<div class="box"><h6><i class="layui-icon">&#xe629;</i>优惠后总金额</h6><hr class="layui-bg-green">-->
    <!--    <div class="content">-->
    <!--        --><?php //echo $order_sum_info['pay_sum'];?>
    <!--    </div>-->
    <!--</div>-->

</div>







<!---->
<!---->
<!--<table class="layui-table">-->
<!--    <thead>-->
<!--    <tr>-->
<!--        <th>客户人数</th>-->
<!--        <th>总货柜数</th>-->
<!--        <th>总金额</th>-->
<!--        <th>总优惠金额</th>-->
<!--        <th>优惠后总金额</th>-->
<!---->
<!--    </tr>-->
<!--    </thead>-->
<!---->
<!--    <tbody>-->
<!--    <tr>-->
<!--        <td>--><?php //echo $order_user_total;?><!--</td>-->
<!--        <td>--><?php //echo $order_count;?><!--</td>-->
<!--        <td>--><?php //echo $order_sum_info['price_sum'];?><!--</td>-->
<!--        <td>--><?php //echo $order_sum_info['discount_sum'];?><!--</td>-->
<!--        <td>--><?php //echo $order_sum_info['pay_sum'];?><!--</td>-->
<!--    </tr>-->
<!--    </tbody>-->
<!--</table>-->

<ul class="indexinfo">


    <!-- // TODO 这部分的统计范围应该取一个时间段。
    //上个月的话，数据太长时间部变，
    //这个月的话，从0开始，数据量不大。
    //统计上一周，数据量也不大。
    //统计最近50天如何？-----------------------暂时偏向这个
    //从头统计起又太吃资源了。
    -->


    <li>
        <div class="box">
            <?
            $sql = "select sum(ou.price-ou.discount) as total,m.* from ".$table_prefix."order_user as ou left join   ".$table_prefix."member as m on m.nid = ou.user_nid where  1 {$ouser_where} group by ou.user_nid order by total desc";

            $result = mysql_query($sql);

            while ($row = mysql_fetch_assoc($result))
            {
                $user_total_list[] = $row;
            }

            ?>
            <h6><i class="fa fa-shopping-cart" aria-hidden="true"></i>消费排行</h6>
            <hr class="layui-bg-green">
            <ol  class="content">
                <? foreach ($user_total_list as $user_key => $user_val ){?>
                    <li><font style="display:inline-block; width: 50%; float:left;"><?echo $user_key+1 ?> : <?echo $user_val['name']?></font>  <span style="display:inline-block; width: 50%;">￥<?echo $user_val['total']?></span>  </li>
                <?;}?>
            </ol>

        </div>
    </li>




    <li>
        <div class="box">
            <?
            $sql = "select sum(ou.price-ou.discount) as total,f.* from ".$table_prefix."order_list as o left join   ".$table_prefix."freight as f on o.country = f.nid left join   ".$table_prefix."order_user as ou on ou.order_nid = o.nid where  1 {$where} group by o.country order by total desc";

            $result = mysql_query($sql);

            while ($row = mysql_fetch_assoc($result))
            {
                $region_total_list[] = $row;
            }

            ?>
            <h6><i class="fa fa-shopping-cart" aria-hidden="true"></i>地区金额排行</h6>
            <hr class="layui-bg-green">
            <ol  class="content">
                <? foreach ($region_total_list as $region_key => $region_val ){?>
                    <li><font style="display:inline-block; width: 50%; float:left;"><?echo $region_key+1 ?> : <?echo $region_val['name']?></font>  <span style="display:inline-block; width: 50%;">￥<?echo $region_val['total']?></span>  </li>
                    <?;}?>
            </ol>


        </div>
    </li>






    <li>
        <div class="box">
            <?
            $p['orderby']="counts desc";
            $p['count']="nid";
            $p['table']=$table_prefix."package";
            $p['groupby']="type_nid";
            $package_type=count_sum_groupby($p);
            ?>
            <h6><i class="fa fa-shopping-cart" aria-hidden="true"></i>产品类型排行</h6>
            <hr class="layui-bg-green">
            <ol  class="content">
                <? foreach ($package_type as $k => $v ){?>
                    <li><font style="display:inline-block; width: 50%; float:left;"><?echo $k+1 ?> :
                            <?echo $v['type_name'] == '' ? '其他': $v['type_name'];?></font>
                        <span style="display:inline-block; width: 50%;"><?echo $v['counts']?></span>
                    </li>
                    <?;}?>
            </ol>


        </div>
    </li>






<!--    <li>-->
<!--        <div class="box">-->
<!--            <h6><i class="fa fa-map-o" aria-hidden="true"></i>地区分布</h6>-->
<!--            <hr class="layui-bg-green">-->
<!--            <div  class="content">-->
<!--                <div  class="content">-->
<!--                    <div>暂无数据...</div>-->
<!--                </div>-->
<!--            </div>-->
<!---->
<!--        </div>-->
<!--    </li>-->
<!---->








    <!--    -->
<!---->
<!--    <li>-->
<!--        <div class="box">-->
<!--            <h6><i class="layui-icon">&#xe7ae;</i>续费信息</h6>-->
<!--            <hr class="layui-bg-green">-->
<!--            <div  class="content">-->
<!--                <b>服务器续费</b>：--><?//echo $site['hostexpire']?><!--<br/>-->
<!--                <b>服务器续费倒数</b>：--><?// echo count_days(date("Y-m-d"),$site['hostexpire'])?><!--日<br/><br/>-->
<!--                <p class="single-ellipsis" style="width: 90%;float: left"><b>域名</b>:--><?//echo $site['domin']?><!--</p><br/>-->
<!--                <b>域名续费</b>：--><?//echo $site['dominexpire']?><!--<br/>-->
<!--                <b>域名续费倒数</b>：--><?// echo count_days(date("Y-m-d"),$site['dominexpire'])?><!--日<br/>-->
<!--            </div>-->
<!--        </div>-->
<!--    </li>-->
<!---->
<!---->
<!---->
<!--    <li>-->
<!--        <div class="box"><h6><i class="layui-icon">&#xe7ae;</i> 系统信息</h6><hr class="layui-bg-green">-->
<!--            <div  class="content">-->
<!--                <b>服务器开通时间</b>：--><?//echo $site['hoststart']?><!--<br/>-->
<!--                <b>运行天数</b>：--><?// echo count_days($site['hoststart'],date("Y-m-d"))?><!--<br/>-->
<!--            </div>-->
<!--        </div>-->
<!--    </li>-->
<!---->
<!---->
<!---->
<!--    <li>-->
<!--        <div class="box">-->
<!--            <h6><i class="layui-icon">&#xe7ae;</i> 服务器</h6><hr class="layui-bg-green">-->
<!--            <div  class="content">-->
<!---->
<!--                <b>使用空间</b>：-->
<!--                <a href="javascript:;" onclick="show_message_box('product','365')">-->
<!--                    --><?// $suerage=getDirSize("../uploadfiles/".$theme_folder);
//                    if($userage<1073741824){echo "<span class='layui-badge layui-bg-green'>非常好</span>";}
//                    elseif($userage>3239225472){echo "<span class='layui-badge layui-bg-orange'>空间紧张</span>";}
//                    ?>
<!--                </a>-->
<!--                <br class="--><?//echo trans_storage_unit($suerage)?><!--"/>-->
<!--            </div>-->
<!--        </div>-->
<!--    </li>-->



</ul>
